<template>
  <div class="organize-table-container">
    <OrganizeTree
      ref="OrganizeTreeRef"
      @activeChange="changeOranize"
      :activeOranize="activeOranize"
      roleType="3"
    />
    <TableList ref="TableListRef" :activeOranize="activeOranize" />
  </div>
</template>

<script setup name="resources-fb-number-history">
import OrganizeTree from '@/components/OrganizeTree';
import TableList from './components/TableList';

const activeOranize = ref({});
const TableListRef = ref();

const OrganizeTreeRef = ref();
onActivated(() => {
  OrganizeTreeRef.value.getData();
  TableListRef.value.getOptions();
});
async function changeOranize(info) {
  const keep = activeOranize.value.id === info.id;
  activeOranize.value = info;
  await nextTick();
  TableListRef.value.initTable(keep);
}
</script>

<style lang="scss" scoped></style>
